import request from './request.js'

export function getNewMvList (area) {
  return request.get('/mv/first', {
    params: {
      area: area,
      limit: 8
    }
  })
}

export function getAllMvList (area, type, order) {
  return request.get('/mv/all', {
    params: {
      area: area,
      type: type,
      order: order,
      limit: 100
    }
  })
}

export function getExclusiveEcmdList () {
  return request.get('/mv/exclusive/rcmd', {
    params: {
      limit: 8
    }
  })
}

export function getMvRankList (limit, area) {
  return request.get('/top/mv', {
    params: {
      limit: limit,
      area: area,
      offset: 0
    }
  })
}

// 获取视频标签列表
export function getVideoGroupList () {
  return request.get('/video/group/list')
}

// 获取视频分类列表
export function getVideoCategoryList () {
  return request.get('/video/category/list')
}

// 获取视频标签/分类下的视频
export function getVideoGroup (id) {
  return request.get('/video/group', {
    params: {
      id: id
    }
  })
}

// 获取全部视频列表
export function getAllVideo () {
  return request.get('/video/timeline/all', {
    params: {
      offset: 0
    }
  })
}

// 获取mv数据
export function getMvDetail (id) {
  return request.get('/mv/detail', {
    params: {
      mvid: id
    }
  })
}

// 获取mv点赞转发评论数数据
export function getMvDetailInfo (id) {
  return request.get('/mv/detail/info', {
    params: {
      mvid: id
    }
  })
}

// 获取mv地址
export function getMvUrl (id) {
  return request.get('/mv/url', {
    params: {
      id: id,
      r: 1080
    }
  })
}
// 获取视频地址
export function getVideoUrl (id) {
  return request.get('/video/url', {
    params: {
      id: id
    }
  })
}
// 获取推荐视频
export function getRecommendVideo (id) {
  return request.get('/video/group', {
    params: {
      id: id,
      offset: 0
    }
  })
}

// 获取相关视频
export function getRelatedVideo (id) {
  return request.get('/related/allvideo', {
    params: {
      id: id
    }
  })
}

// 获取视频点赞转发评论数数据
export function getVideoDetailInfo (id) {
  return request.get('/video/detail/info', {
    params: {
      vid: id
    }
  })
}

// mv评论
export function getMvComment (id) {
  return request.get('/comment/mv', {
    params: {
      id: id
    }
  })
}

// 视频评论
export function getVideoComment (id) {
  return request.get('/comment/video', {
    params: {
      id: id
    }
  })
}

// 获取视频详情数据
export function getVideoDetail (id) {
  return request.get('/video/detail', {
    params: {
      id: id
    }
  })
}
